package com.superman.supermarket.client.composite.mycouponlist;

import java.util.Map;

import com.superman.supermarket.client.constant.CouponStateConstants;

/**
 * 我的优惠券列表失效
 * 
 * @author superman
 * @version 2018年8月19日下午10:54:35
 */
public class CouponListCellInvalidModule extends CouponListCellModule {

	/**
	 * 构造方法
	 * 
	 * @author superman
	 * @version 2018年8月19日 下午10:55:26
	 */
	public CouponListCellInvalidModule() {
		getbtn.setText("");

		namehtml.getElement().getStyle().setProperty("color", "#666");
		limithtml.getElement().getStyle().setProperty("color", "#666");
		timehtml.getElement().getStyle().setProperty("color", "#666");
		getbtn.getElement().getStyle().setProperty("color", "#666");
	}

	@Override
	public void setData(Map<String, Object> map) {
		super.setData(map);

		int couponState = (int) Double.parseDouble(String.valueOf(map.get("COUPON_STATE")));
		switch (couponState) {
			case CouponStateConstants.COUPON_STATE_FROZEN:
				getbtn.setText("已冻结");
				break;
			case CouponStateConstants.COUPON_STATE_OVERFRESH:
				getbtn.setText("已过期");
				break;
			case CouponStateConstants.COUPON_STATE_USED:
				getbtn.setText("已使用");
				break;
			case CouponStateConstants.COUPON_STATE_INVALID:
				getbtn.setText("已失效");
				break;
			default:
				break;
		}
	}

}
